<template>
  <div id="app">

     <transition :name="transitionName" @afterLeave="clearTransition">
	  	<!-- <keep-alive> -->
		  <router-view/>
	  	<!-- </keep-alive> -->
	  </transition>



    <!--<footer class="footers" v-if="this.$route.path!='/pay_detail'">-->
      <!--<div  @click='$router.push("/help")' v-if="!$store.state.login">-->
          <!--<img src="https://gss0.bdstatic.com/5eR1dDebRNRTm2_p8IuM_a/resource/jingcai-mobile/img/app-help.65df866.png">-->
          <!--<span>帮助 / 规则</span>-->
      <!--</div>-->
      <!--<div v-if="$store.state.login">-->
          <!--<img src="https://gss0.bdstatic.com/5eR1dDebRNRTm2_p8IuM_a/resource/jingcai-mobile/img/app-help.65df866.png">-->
          <!--<span>金币：{{$store.state.moneys}}</span>-->
      <!--</div>-->
      <!--<div @click='locahost()'>-->
          <!--<img src="https://gss0.bdstatic.com/5eR1dDebRNRTm2_p8IuM_a/resource/jingcai-mobile/img/app-help.65df866.png">-->
          <!--<span>奖品兑换</span>-->
      <!--</div>-->
    <!--</footer>-->
  </div>
</template>

<script>
	import { mapState } from 'vuex';
	import store from './store';
  import heads from './components/header';

export default {
		name: 'app',
		data() {
			return {
				prevRoutes: [],
				ispage:false,
        islogin:sessionStorage.getItem('login'),
        money:this.$store.state.moneys,
        loca:'',

			}
		},
		watch: {
			/* ========================================
			 * Apply Slide Transition Effects For
			 * Each Route Switch,Except Some Route That
			 * Don't Need Transition Effect
			 * ========================================= */
			$route(to, from) {
//        if(!from.meta.noPageAnimation){
//					from.meta.noPageAnimation=true
//					return false
//				}
				if((to.meta.noPageAnimation || from.meta.noPageAnimation)) {
      // console.log(66)
					if (to.name === this.prevRoutes[this.prevRoutes.length-1]) {
						store.commit('transition/setTransition', 'turn-off');
						this.prevRoutes.pop();
					}else {
						if (from.name != null) {
							store.commit('transition/setTransition', 'turn-on');
							this.prevRoutes.push(from.name);
						}
					}

				}
			}
		},
		computed: {
			...mapState('transition', ['transitionName']),

		},
    updated(){

//      this.islogin=sessionStorage.getItem('login');
    },
    mounted(){

//      this.islogin=sessionStorage.getItem('login')
    },
		methods: {

      clearTransition() {
          store.commit('transition/setTransition', '');
      },
      locahost:function () {
          const _this=this;
//          const  islogin=sessionStorage.getItem('login');
//        _this.loca=(islogin!='false'&&islogin!=undefined?'/prize':'/login')
//        this.$router.push({path:this.loca})
      }
		},
  components: {
    heads,
//    footers
  }

};
</script>

<style>

html,body{
  margin: 0;
  padding: 0;
  height:100%;
  /* background-color: #1b1f2e; */
  background: #fff;
}

.page .page-content{
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    min-height: 567px;
  background: #fff;
    /* background-color: #1b1f2e; */
}
.page .page-content{
	padding-top: 45px;
	padding-bottom: 65px;
	overflow: auto;
}
a{
 color:  #6b7fa7;
}
* {
  box-sizing: border-box;
}
#app {
  height: 100%;
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;

}
  .footers{
    width: 100%;
    position: fixed;
    bottom: 0;
    right: 0;
    left:0;
    z-index: 777;
    height:40px;
    background-color: #000;
    display: flex;
    text-align: center;
  }
.footers>div{
  width: 50%;
  line-height: 40px;
}
.footers>div:first-child{
  border-right: 1px solid #1e2231;
}
.footers img{
  width: 15px;
  height:15px;
}
</style>

